#pragma once
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include "../../3rd/libjson/json.h"

using namespace boost::property_tree;
/*
	玩家续充类
*/

enum ERewardState
{
	ERS_begin = -2,			//开始值
	ERS_none = -1,				// 不可领取
	ERS_avaliable = 0,			//可领取
	ERS_taken = 1,				//已领取
	ERS_end	= 2,				//结束值
};

// 领奖状态
struct RewardState
{
	int _iID;
	int _iState;

	RewardState()
	{
		_iID = 0;
		_iState = ERS_none;
	}

	int GetId()
	{
		return _iID;
	}

	void SetId( int iId )
	{
		_iID = iId;
	}

	int GetState()
	{
		return _iState;
	}

	void SetState( int iState )
	{
		_iState = iState;
	}

};

class CContinueRecharge
{

public:
	CContinueRecharge();
	~CContinueRecharge();
	
	void Init();
	void SetPlayerId( int iPlayerId );

	int GetPlayerId();

	void SetRechargeTotalQuantity( float fQuantity );

	float GetRechargeTotalQuantity();


	void SetRewardState( RewardState const & rs );

	RewardState GetRewardState();

	void ReadFromJson( Json::Value const & jsv );

	void ReadFromPtree ( ptree && ptreeTmp );

	void Write2Json( Json::Value & jsv );

private:

	int _iPlayerId;

	// 总充值数
	float _fRechargeTotalQuantity;

	// 领奖状态
	RewardState _rsRewardState;	

};
